package com.jinglvhuanjing.app.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;

import com.jinglvhuanjing.app.R;
import com.jinglvhuanjing.app.utils.ByteUtil;
import com.jinglvhuanjing.app.utils.SingletonSerl;

import org.greenrobot.eventbus.EventBus;

public class ParamSettingRow4SecView extends ConstraintLayout {

    public ParamSettingRow4SecView(@NonNull Context context) {
        super(context);
        this.init(context);
    }

    public ParamSettingRow4SecView(@NonNull Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        this.init(context);
    }

    public ParamSettingRow4SecView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        this.init(context);
    }

    /*** 1号设置 ***/
    private ParamSettingTermTkView device_config_status_1;
    /*** 2号设置 ***/
    private ParamSettingTermTkView device_config_status_2;
    /*** 3号设置 ***/
    private ParamSettingTermTkView device_config_status_3;
    /*** 4号设置 ***/
    private ParamSettingTermTkView device_config_status_4;
    /*** 5号设置 ***/
    private ParamSettingTermTkView device_config_status_5;

    private void init(Context context) {
        LayoutInflater.from(context).inflate(R.layout.view_params_setting_row_4_sec_layout, this, true);
        device_config_status_1 = findViewById(R.id.device_config_status_1);
        device_config_status_2 = findViewById(R.id.device_config_status_2);
        device_config_status_3 = findViewById(R.id.device_config_status_3);
        device_config_status_4 = findViewById(R.id.device_config_status_4);
        device_config_status_5 = findViewById(R.id.device_config_status_5);

        device_config_status_1.setLabel("1号设置", ByteUtil.hexByteToString(SingletonSerl.byte_tk1));
        device_config_status_2.setLabel("2号设置", ByteUtil.hexByteToString(SingletonSerl.byte_tk2));
        device_config_status_3.setLabel("3号设置", ByteUtil.hexByteToString(SingletonSerl.byte_tk3));
        device_config_status_4.setLabel("4号设置", ByteUtil.hexByteToString(SingletonSerl.byte_tk4));
        device_config_status_5.setLabel("5号设置", ByteUtil.hexByteToString(SingletonSerl.byte_tk5));
        device_config_status_1.setTkVisible(true);
    }

    public void onDestroy() {
        device_config_status_1.onDestroy();
        device_config_status_2.onDestroy();
        device_config_status_3.onDestroy();
        device_config_status_4.onDestroy();
        device_config_status_5.onDestroy();
    }

}
